#include "auxiliary_function.h"

std::string GetOperateSystem() {
#ifdef __linux__
    return "Linux";
#endif
    return "Windows";
}

std::string GetMainDirectory() {
    std::string _os;
    _os = GetOperateSystem();
    std::string mainDirectory;
    if (_os == "Linux") {
        mainDirectory = GetCurrentUserDirectory();
    } else {
        mainDirectory = "D://";
    }
    return mainDirectory;
}

std::string GetCurrentTime() {
    return "";
}

std::string GetCurrentDate() {
    return "";
}

int* GetScreenSize() {
    int *size = new int[2];
    QDesktopWidget *desktop = new QDesktopWidget();
    size[0] = desktop -> screenGeometry().width();
    size[1] = desktop -> screenGeometry().height();
    delete desktop;
    return size;
}

std::string GetCurrentUserDirectory() {
    char buffer[256];
    std::string cud;
    if (getcwd(buffer, 256) != NULL) {
        cud = buffer;
    } else {
        cud = "/home";
    }
    return cud;
}

std::string GetCurrentWorkDirectory() {
    std::string cud = GetCurrentUserDirectory();
    cud.append("/Github/QMarkDown/src");
    std::string cwd(cud);
    return cwd;
}
